#include "widget.h"
#include "ui_widget.h"
#include "mylabel.h"
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>


Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    button = new QPushButton(this);
    button->setText("关闭");

    connect(button, &QPushButton::clicked, this, &Widget::close);

    button->move(200, 300);

//    QLineEdit* line = new QLineEdit(this);
//    line->setText("hello world");


//    QLabel* label = new QLabel(this);
//    label->setText("Hello world");

//    MyLabel* myl = new MyLabel(this);
//    myl->setText("hello world");
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleClick()
{
    if(button->text() == QString("hello world"))
        button->setText("hello button");
    else
        button->setText("hello world");
}

